home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_input_button.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  4.0 KB  |  85 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="430" height="250" caption="Button">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblValue" caption="Text/value" hint="Text/value of your form element." width="69" height="13" top="8" left="208"/>
  6.             <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="29" height="13" top="8" left="8"/>
  7.             <edit name="edtValue" taborder="1" text="" hint="Text/value of your form element." width="175" height="19" top="24" left="208"/>
  8.             <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="175" height="19" top="24" left="8"/>
  9.             <checkbox name="cbDisabled" caption="Disabled" taborder="2" hint="Your element will be visible, but disabled." checked="0" width="121" height="17" top="56" left="8"/>
  10.         </panel>
  11.     </controls>
  12.     <dialogevents>
  13.         <event type="onclose" resulttype="ok">
  14.  
  15.             StartCode := ('<input type="button"');
  16.             if edtName.Text <> '' then
  17.              StartCode := StartCode + (' name="'+(edtName.Text)+'"');
  18.             if edtValue.Text <> '' then
  19.              StartCode := StartCode + ' value="'+edtValue.Text+'"';
  20.             if cbDisabled.Checked then
  21.              StartCode := StartCode + (' disabled');
  22.  
  23.               If edtCSSClass.Text <> '' then
  24.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  25.               If edtCSSId.Text <> '' then
  26.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  27.               If edtCSSStyle.Text <> '' then
  28.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  29.             for i := 0 to EventGrid.Count - 1 do
  30.               begin
  31.               if EventGrid.Rows[i].EditText <> '' then
  32.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  33.              end;
  34.  
  35.             StartCode := StartCode + '>';
  36.             If cbMakeXHTMLCompliant.Checked then
  37.              StartCode := MakeXHTMLCompliant(StartCode, false);
  38.             If cbDoPHPEscape.Checked then
  39.              StartCode := DoPHPEscape(StartCode);
  40.             // A little "hack" - WebCoder will set this, to let us know whether to update
  41.             // an existing tag, or insert a brand new one
  42.             If cbUpdateExistingTag.Checked then
  43.              ReplaceTag(StartCode)
  44.             else
  45.                InsertTags(StartCode, '');
  46.  
  47.         </event>
  48.         <event type="onshow">
  49.             // Lets put the advanced panel in the right place
  50.             pnlAdvanced.Parent := MainPanel;
  51.             pnlAdvanced.Left := 8;
  52.             pnlAdvanced.Top := MainPanel.Height - 32;
  53.             pnlAdvanced.Width := Self.Width - 36;
  54.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  55.             If pnlAdvanced.Height > 20 then
  56.              Self.Height := Self.Height + 200;
  57.         </event>
  58.         <event type="updatedialog">
  59.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  60.             // The entire selected tag will be passed as a parameter to this function, that should update
  61.             // the required fields of the dialog.
  62.             function UpdateDialog(Tag: string);
  63.              begin
  64.  
  65.               edtName.Text := GetValueFromAttribute(Tag, 'name');
  66.               edtValue.Text := GetValueFromAttribute(Tag, 'value');
  67.  
  68.               cbDisabled.Checked := HasOption(Tag, 'disabled');
  69.                   
  70.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  71.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  72.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  73.               for i := 0 to EventGrid.Count - 1 do
  74.                 begin
  75.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  76.                  If EventVal <> '' then
  77.                   EventGrid.Rows[i].EditText := EventVal;
  78.                end;
  79.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  80.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();
  81.              end;
  82.         </event>
  83.     </dialogevents>
  84. </dialog>
  85.